wayland: Ensure the parent is committed after repositioning subsurfaces
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 27 Aug 2014 10:03:28 +0000 (12:03 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 27 Aug 2014 15:45:16 +0000 (17:45 +0200)
Subsurface position is deemed part of the state of the parent surface, so
ensure wl_surface_commit() happens on the parent surface if none is
scheduled, so the repositioning takes place.

gdk/wayland/gdkwindow-wayland.c

index 6875099d0e6fa6224127b24d88abfc59d7159da6..e8b2ecf2e1105403db67a6766293ec4c68092555 100644 (file)
@@ -1265,7 +1265,17 @@ gdk_window_wayland_move_resize (GdkWindow *window,
           window->y = y;
 
           if (impl->subsurface)
-            wl_subsurface_set_position (impl->subsurface, x, y);
+            {
+              GdkWindowImplWayland *parent_impl;
+
+              wl_subsurface_set_position (impl->subsurface, x, y);
+
+              g_assert (impl->transient_for != NULL);
+              parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+
+              if (parent_impl->surface && !parent_impl->pending_commit)
+                wl_surface_commit (parent_impl->surface);
+            }
         }
     }